<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="message.lable.DICyiLiaoJiGouLeiXingWeiHuJiLu"/></title>
	
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.lable.DICyiLiaoJiGouLeiXingWeiHuJiLu"/></h1>
        <ol class="breadcrumb">
           <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.DicManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.hosptypeDic"/></a></li>
        </ol>
    </section>
    
    <section class="content">
    	<div class=" box box-success">
        
            <div class="box-body">
                <div class="form-inline">
                    <div class="form-group form-group-xs">
                        <label><spring:message code="message.listForm.xiuGaiRiQi"/>：</label>
                        <input class="form-control" id="startTime" type="text" placeholder="yyyy-MM-dd" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}'})"  />
                        -
                        <input class="form-control" id="endTime" type="text" placeholder="yyyy-MM-dd" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}'})"  />
                    </div>
                    <button type="button" class="btn btn-success btn-sm"  onclick="search();"><spring:message code="message.button.seachSpacing"/></button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
                <a href="dicHosptypeList.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
        </div>
    </section>
  
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    //查询
	function search() {
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		$("#gridlist").jqGrid('setGridParam',{  
	        postData:{"startTime":startTime, "endTime":endTime},
	        page : 1
	    }).trigger("reloadGrid"); //重新载入  
	}
	
        $(function () {
            $("#gridlist").jqGrid({
                url: "querydicHosptypeLogJson.html",
                mtype: "GET",
                datatype: "json",
                postData: {"tid" : "${tid}"},
                autowidth: true,
                height: 270,
                colNames: ['<spring:message code="message.jqGrid.cz"/>',
                           '<spring:message code="message.listForm.xiuGaiXiangQing"/>',
                           '一级医疗机构编码', '一级医疗机构名称', '二级医疗机构编码', '二级医疗机构名称', '状态',
                           '<spring:message code="message.listForm.xiuGaiRen"/>', 
                           '<spring:message code="message.listForm.xiuGaiShiJian"/>'],
                colModel: [
					
					{ name: 'operate', index: 'operate',width:60,key:true, align: "center",
					    formatter : function(val, opts, rowdata) {
					     return "<a href='${ctx}/dict/toDicHosptypeLogDetail.html?logId="+rowdata.logId+ "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>"; 
					     }
					},
					{ name: 'detail', index: 'code', width: 550,align:"left", sortable: false},
                    { name: 'fatherHospTypeCode', index: 'code', width: 100,align:"center", sortable: false,hidden:true },
                    { name: 'fatherHospType', index: 'name', width: 150,align:"center", sortable: false,hidden:true },
                    { name: 'hospTypeCode', index: 'fcode', width: 100,align:"center", sortable: false,hidden:true},
                    { name: 'hospType', index: 'fname', width: 150,align:"center", sortable: false ,hidden:true},
                    { name: 'status', index: 'status', width: 50, align: 'center',sortable: false,hidden:true},
                    { name: 'updUser', index: 'ship', width: 140,align:"center", sortable: false },
                    { name: 'updDatetime', align: 'center',width:140,sortable: false}
		        ],
                rowNum: 10,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                gridComplete: function(){
                	var page = $("#gridlist").jqGrid('getGridParam','page');
            		var rows = $('#gridlist').getGridParam("rowNum");
            		var maxnum = (rows*page).toString();
            		var len = (maxnum.length)*10;
            		$('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                	$('#gridlist_rn').css('width',len+'px');
                },
                caption: "${hospTypeCode} - ${hospType}&nbsp;<spring:message code="message.jqGrid.cz.weiHuJiLuLieBiao"/>",
                jsonReader: {
                    repeatitems: false,
                    id: "ids"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        
    	 function CurentTime(now)  
    	{       	         
    	    var year = now.getFullYear();   
    	    var month = now.getMonth() + 1; 
    	    var day = now.getDate();     
    	         
    	    var hh = now.getHours();       
    	    var mm = now.getMinutes(); 
    	    var ss=now.getSeconds();  
    	    var clock = year + "-"; 
    	    if(month < 10) clock += "0";         
    	    clock += month + "-";  
    	    if(day < 10) clock += "0";   
    	    clock += day + " "; 
    	    if(hh < 10) clock += "0";  
    	    clock += hh + ":";  
    	    if (mm < 10) clock += '0';   
    	    clock += mm+ ":";  
    	    if (ss < 10) clock += '0';   
    	    clock += ss; 
    	    return(clock);    
    	} 
    </script>
</body>
</html>